import React, {Component} from 'react'
import Header from './common/header'
import Home from './pages/home'
import Detail from './pages/detail/loadable.js'
import Login from './pages/login'
import write from './pages/write'
import {GlobalStyle} from './style'
import {GlobalStyleiconfont} from './statics/iconfont/iconfont'
import {Provider} from 'react-redux'
import {BrowserRouter, Route}  from 'react-router-dom'
import store from './store'
class App extends Component{
  render() {
    return (
      <React.Fragment>
        <GlobalStyle/>
        <GlobalStyleiconfont/>
        <Provider store = {store}>
          <BrowserRouter>
            <div>
            <Header/>
              <Route path='/' exact component={Home}></Route>
              <Route path='/login' exact component={Login}></Route>
              <Route path='/detail/:id' exact component={Detail}></Route>
              <Route path='/write' exact component={write}></Route>
            </div>
          </BrowserRouter>
        </Provider>
      </React.Fragment>
    )
  }
}

export default App;
